﻿using ReflectionStudio.Core.Events;
using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
namespace WPFExcelReport
{
    public partial class UIBSGROE : ViewBase
    {
        #region ==KETTART===========
        public static readonly DependencyProperty KETTARTProperty = DependencyProperty.Register("KETTART",
        typeof(string), typeof(UIBSGROE),
        new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnKETTARTChanged));
        public string KETTART
        {
            get
            {
                return (string)GetValue(KETTARTProperty);
            }
            set
            {
                SetValue(KETTARTProperty, value);
                OnKETTARTChg();
            }
        }
        private static void OnKETTARTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIBSGROE;
            if (src != null)
            {
                src.KETTART = (string)e.NewValue;
            }
        }
        public virtual void OnKETTARTChg()
        {

        }
        #endregion
        public VBSGROE TMV
        {
            get
            {
                return (VBSGROE)MV;
            }
        }
        public UIBSGROE()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
        }

        public override void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            base.Window_Loaded(sender, e);

        }
        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e);

            if (dwMaster == null)
            {
                KEY = "";
                KETTART = "";
            }
            else
            {
                KEY = TMV.BSGART + TMV.BSGKETTART;
                KETTART = TMV.BSGKETTART;
            }
        }
      
    }
}
